//
//  MediaBook.h
//  Dolphin
//
//  Created by Handymood on 11-5-22.
//  Copyright 2011 __Hanydmood__. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "SinglePage.h"
#import "LayerInfo.h"
#import "MediaBookXMLParser.h"
#import "GlobalSet.h"
#import "UIComponentBase.h"
#import "IndexPageInfo.h"
#import "IndexPage.h"
#import "TopBar.h"
#import "BottomBar.h"
#import "DolphinUIWebLayer.h"
#import "MediaBookBase.h"
#import "ColorUtil.h"
#import "DolphinUICategory.h"
#import "UICategoryUnit.h"
#import "MsgPanel.h"

@class SinglePage;
@class LayerInfo;
@class MediaBookXMLParser;
@class GlobalSet;
@class UIComponentBase;
@class IndexPageInfo;
@class IndexPage;
@class TopBar;
@class BottomBar;
@class DolphinUIWebLayer;
@class MediaBookBase;
@class ColorUtil;
@class DolphinUICategory;
@class UICategoryUnit;
@class MsgPanel;

@interface MediaBook : MediaBookBase <UIScrollViewDelegate, UIActionSheetDelegate>
{
    UIImageLayer *backGroundImage;
    UIView           *bgView;
    BottomBar     *bottomBar;
    DolphinUIWebLayer  *webLayer;
    DolphinUICategory    *categoryLayer;
    UIActionSheet *theActionSheet;
    MsgPanel        *msgPanel;
    
    UIActivityIndicatorView *activityIndicator;
    UIInterfaceOrientation    preOrientation;

    NSTimer *objQueMagTimer;
    
    float previous_scroll_pos;

    BOOL bar_status_hidden;
    float top_bar_ori_y;
    float bottom_bar_ori_y;
    
    BOOL scroll_block_signal;

    int screen_direction;//0:vertical 1:horizontal

    BOOL webLayerOn;
    BOOL categoryOn;
    
    double currentTime;
    double previousTime;
    
    NSString *loadOverMsg;
    int previousNode;
}

@property UIInterfaceOrientation    preOrientation;

-(void) initWithGlobalSet:(GlobalSet *) inGlobalSet;
-(void) initBook:(NSString *) configXmlAdd
                suffix:(NSString *) inSuffix
 curOrientation:(UIInterfaceOrientation)interfaceOrientation;

-(void) initBookContent;

-(void) notificationSelector:(NSNotification *) notification;

-(void) statusBarAnimationTrigger;

-(void) layoutAdjustWithOrientation:(UIInterfaceOrientation)interfaceOrientation 
                                orientaionType:(NSString *) inOrientationType;

-(void) closeCategoryLayer;

-(void) shiftToPageId:(int) inId;
-(void) shiftToPre;
-(void) shiftToNext;

-(void) reset;

@end
